#include<bits/stdc++.h>
using namespace std;
#define int long long

const int N=1e5;
int n,s,ms=N+5,ml,ans;
int a[N+5];
signed main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    ans=n;
    for(int i=1;i<=n;i++){
        cin>>s;
        a[s]++;
        ms=min(ms,s);
        ml=max(ml,s);
    }
    for(int i=ms;i<=ml;i++){
        if(a[i]-a[i-1]>=0){
            ans-=a[i-1];
        }
        else{
            ans-=a[i];
        }
        a[i]=max(a[i],a[i-1]);
    }
    cout<<ans;
    return 0;
}
